﻿/*----------------------------------------------------------------------------------------
*
*  Copyright 2019, Gao Hai Hui, <fromzeropoint@126.com>.  All rights reserved.
*  https://gitee.com/helloworldghh/xoskit.git
*  Use of this source code is governed by a MIT license
*  that can be found in the License file.
*
----------------------------------------------------------------------------------------*/
#ifndef __IMPL_MGR_H__
#define __IMPL_MGR_H__

namespace xos_box
{

    class mgr : public i_box_mgr
    {
    public:
        typedef xos::release_impl< mgr > T;

    public:
        mgr();
        ~mgr();

    public:
        static int static_init( xos::i_xos * pXosImpl, xos_common::i_common * pCommon, xos_log::i_log * pLog, i_box_mgr ** ppv );
        static xos_common::i_common * common();
        static xos_log::i_log * log();
        static xos_box::i_big_buf * big_buf();
        static xos_box::i_buf * buf();
        static xos::i_misc * misc();
        static xos::i_crt * crt();
        static xos::i_xos * xos();
        static mgr * get();

    public:
        // 初始化及创建对象
        int create( enumObj eType, void ** ppv );

    protected:
        int put_back_to_pool( T * pT, bool bLock );
        int init_data();
        int init();
        int term();

    };

} // xos_box

#endif // __IMPL_MGR_H__
